server: fix vm deployment without networkid in a zone with shared networks#11242
Conversation
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #11242 +/- ##
============================================
- Coverage 15.18% 15.17% -0.01%
- Complexity 11363 11366 +3
============================================
Files 5415 5415
Lines 476061 476061
Branches 58122 58122
============================================
- Hits 72269 72263 -6
- Misses 395702 395710 +8
+ Partials 8090 8088 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14242 |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14244 |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14252 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-13820)
|
|
@weizhouapache , the issue is reported on 4.19.2, should we base this on the 4.19 branch? |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14554 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
There was a problem hiding this comment.
LGTM - Tested and verified - the fix works correctly.
Test Environment
- CloudStack Version: 4.19.x with PR code
- Zone Type: Advanced Zone with shared networks
- Network Setup: Shared network with security groups owned by ROOT
- Test Account: Regular user account (not admin)
Test Results
Regression Test - PASSED
Results without networkids parameter (with shared + isolated network):
(localcloud) 🐱 > deploy virtualmachine displayname=pr11242-regression-test domainid=793fb714-7213-11f0-b207-1e00e0000162 securitygroupnames=pr11242-test-sg serviceofferingid=fb167f79-2995-41e6-886d-5a0db529a3af templateid=79465b9c-7213-11f0-b207-1e00e0000162 zoneid=8ee99a5c-7aca-45cc-97d3-a3d1a84c5503 account=pr11242user
{
"virtualmachine": {
"account": "pr11242user",
"affinitygroup": [],
"cpunumber": 1,
"cpuspeed": 500,
"created": "2025-08-05T17:59:53+0000",
"details": {
"cpuOvercommitRatio": "2.0"
},
"displayname": "pr11242-regression-test",
"displayvm": true,
"domain": "ROOT",
"domainid": "793fb714-7213-11f0-b207-1e00e0000162",
"domainpath": "/",
"guestosid": "796544f2-7213-11f0-b207-1e00e0000162",
"haenable": false,
"hasannotations": false,
"hostcontrolstate": "Enabled",
"hostid": "dc80ec52-96c8-4b0e-870e-189300e55daf",
"hostname": "ref-trl-9163-k-Mol8-rositsa-kyuchukova-kvm2",
"hypervisor": "KVM",
"id": "a4cae218-09ab-43f0-b139-45b7d561c53f",
"instancename": "i-5-3-VM",
"ipaddress": "10.1.1.218",
"isdynamicallyscalable": false,
"jobid": "b5c49339-808d-467f-bed1-7de663fbdc0f",
"jobstatus": 0,
"lastupdated": "2025-08-05T18:00:54+0000",
"memory": 512,
"name": "VM-a4cae218-09ab-43f0-b139-45b7d561c53f",
"nic": [
{
"broadcasturi": "vlan://1467",
"deviceid": "0",
"extradhcpoption": [],
"gateway": "10.1.1.1",
"id": "2b136221-7de5-4691-8e39-25fdb75ea71b",
"ipaddress": "10.1.1.218",
"isdefault": true,
"isolationuri": "vlan://1467",
"macaddress": "02:01:00:cd:00:01",
"netmask": "255.255.255.0",
"networkid": "22240880-8c47-480b-9294-cf7759f84b4f",
"networkname": "pr11242user-network",
"secondaryip": [],
"traffictype": "Guest",
"type": "Isolated"
}
],
"osdisplayname": "CentOS 5.5 (64-bit)",
"ostypeid": "796544f2-7213-11f0-b207-1e00e0000162",
"passwordenabled": false,
"pooltype": "NetworkFilesystem",
"receivedbytes": 0,
"rootdeviceid": 0,
"rootdevicetype": "ROOT",
"securitygroup": [],
"sentbytes": 0,
"serviceofferingid": "fb167f79-2995-41e6-886d-5a0db529a3af",
"serviceofferingname": "Small Instance",
"state": "Running",
"tags": [],
"templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
"templateformat": "QCOW2",
"templateid": "79465b9c-7213-11f0-b207-1e00e0000162",
"templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
"templatetype": "BUILTIN",
"userid": "5eb1d817-c560-484b-afc1-73b846ab0a1d",
"username": "pr11242user",
"zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
"zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
}
}
Result: VM deployed successfully on user's isolated network
Results without networkids parameter (with shared network only):
(localcloud) 🐱 > deploy virtualmachine displayname=pr11242-regression-test domainid=793fb714-7213-11f0-b207-1e00e0000162 securitygroupnames=pr11242-test-sg serviceofferingid=fb167f79-2995-41e6-886d-5a0db529a3af templateid=79465b9c-7213-11f0-b207-1e00e0000162 zoneid=8ee99a5c-7aca-45cc-97d3-a3d1a84c5503 account=pr11242user
{
"virtualmachine": {
"account": "pr11242user",
"affinitygroup": [],
"cpunumber": 1,
"cpuspeed": 500,
"created": "2025-08-06T06:14:24+0000",
"details": {
"cpuOvercommitRatio": "2.0"
},
"displayname": "pr11242-regression-test",
"displayvm": true,
"domain": "ROOT",
"domainid": "793fb714-7213-11f0-b207-1e00e0000162",
"domainpath": "/",
"guestosid": "796544f2-7213-11f0-b207-1e00e0000162",
"haenable": false,
"hasannotations": false,
"hostcontrolstate": "Enabled",
"hostid": "d3593fd2-513e-4f63-ae5e-abf744740169",
"hostname": "ref-trl-9163-k-Mol8-rositsa-kyuchukova-kvm1",
"hypervisor": "KVM",
"id": "6ecd7c74-f04c-49e9-b9b7-16c8f7ef7254",
"instancename": "i-5-9-VM",
"ipaddress": "10.1.1.61",
"isdynamicallyscalable": false,
"jobid": "c160be07-1680-468d-b539-717fcb016498",
"jobstatus": 0,
"lastupdated": "2025-08-06T06:14:30+0000",
"memory": 512,
"name": "VM-6ecd7c74-f04c-49e9-b9b7-16c8f7ef7254",
"nic": [
{
"broadcasturi": "vlan://1469",
"deviceid": "0",
"extradhcpoption": [],
"gateway": "10.1.1.1",
"id": "07a5146b-901a-4436-ad48-d412e21a7f01",
"ipaddress": "10.1.1.61",
"isdefault": true,
"isolationuri": "vlan://1469",
"macaddress": "02:01:00:ce:00:03",
"netmask": "255.255.255.0",
"networkid": "c40ea500-75a9-451e-ad8c-69cebcd604e3",
"networkname": "pr11242user-network",
"secondaryip": [],
"traffictype": "Guest",
"type": "Isolated"
}
],
"osdisplayname": "CentOS 5.5 (64-bit)",
"ostypeid": "796544f2-7213-11f0-b207-1e00e0000162",
"passwordenabled": false,
"pooltype": "NetworkFilesystem",
"receivedbytes": 0,
"rootdeviceid": 0,
"rootdevicetype": "ROOT",
"securitygroup": [],
"sentbytes": 0,
"serviceofferingid": "fb167f79-2995-41e6-886d-5a0db529a3af",
"serviceofferingname": "Small Instance",
"state": "Running",
"tags": [],
"templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
"templateformat": "QCOW2",
"templateid": "79465b9c-7213-11f0-b207-1e00e0000162",
"templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
"templatetype": "BUILTIN",
"userid": "5eb1d817-c560-484b-afc1-73b846ab0a1d",
"username": "pr11242user",
"zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
"zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
}
}
Result: VM deployed successfully on the shared network
Control Test - PASSED
Results with explicit networkids parameter:
(localcloud) 🐱 > deploy virtualmachine displayname=pr11242-control-test domainid=793fb714-7213-11f0-b207-1e00e0000162 networkids=72ee02a2-1b13-49e5-9986-7dc0141dc0a5 serviceofferingid=fb167f79-2995-41e6-886d-5a0db529a3af templateid=79465b9c-7213-11f0-b207-1e00e0000162 zoneid=8ee99a5c-7aca-45cc-97d3-a3d1a84c5503 account=pr11242user
{
"virtualmachine": {
"account": "pr11242user",
"affinitygroup": [],
"cpunumber": 1,
"cpuspeed": 500,
"created": "2025-08-05T18:00:58+0000",
"details": {
"cpuOvercommitRatio": "2.0"
},
"displayname": "pr11242-control-test",
"displayvm": true,
"domain": "ROOT",
"domainid": "793fb714-7213-11f0-b207-1e00e0000162",
"domainpath": "/",
"guestosid": "796544f2-7213-11f0-b207-1e00e0000162",
"haenable": false,
"hasannotations": false,
"hostcontrolstate": "Enabled",
"hostid": "d3593fd2-513e-4f63-ae5e-abf744740169",
"hostname": "ref-trl-9163-k-Mol8-rositsa-kyuchukova-kvm1",
"hypervisor": "KVM",
"id": "bed8a716-cf95-4d54-8f88-598c6a6edae0",
"instancename": "i-5-5-VM",
"ipaddress": "10.0.100.38",
"isdynamicallyscalable": false,
"jobid": "6eb4f412-1eea-4220-8ea8-5686630b2897",
"jobstatus": 0,
"lastupdated": "2025-08-05T18:01:48+0000",
"memory": 512,
"name": "VM-bed8a716-cf95-4d54-8f88-598c6a6edae0",
"nic": [
{
"broadcasturi": "vlan://52",
"deviceid": "0",
"extradhcpoption": [],
"gateway": "10.0.100.1",
"id": "04f92c86-8c91-4ed6-a3be-9e84f883ddb0",
"ipaddress": "10.0.100.38",
"isdefault": true,
"isolationuri": "vlan://52",
"macaddress": "1e:00:6a:00:00:45",
"netmask": "255.255.255.0",
"networkid": "72ee02a2-1b13-49e5-9986-7dc0141dc0a5",
"networkname": "pr11242-shared-network",
"secondaryip": [],
"traffictype": "Guest",
"type": "Shared"
}
],
"osdisplayname": "CentOS 5.5 (64-bit)",
"ostypeid": "796544f2-7213-11f0-b207-1e00e0000162",
"passwordenabled": false,
"pooltype": "NetworkFilesystem",
"receivedbytes": 0,
"rootdeviceid": 0,
"rootdevicetype": "ROOT",
"securitygroup": [
{
"account": "pr11242user",
"description": "Default Security Group",
"egressrule": [],
"id": "085aa356-eee3-48b2-a987-2dce4a8e7c08",
"ingressrule": [],
"name": "default",
"tags": [],
"virtualmachineids": []
}
],
"sentbytes": 0,
"serviceofferingid": "fb167f79-2995-41e6-886d-5a0db529a3af",
"serviceofferingname": "Small Instance",
"state": "Running",
"tags": [],
"templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
"templateformat": "QCOW2",
"templateid": "79465b9c-7213-11f0-b207-1e00e0000162",
"templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
"templatetype": "BUILTIN",
"userid": "5eb1d817-c560-484b-afc1-73b846ab0a1d",
"username": "pr11242user",
"zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
"zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
}
}
Result: VM deployed successfully on ROOT-owned shared network
(localcloud) 🐱 > list networks id=72ee02a2-1b13-49e5-9986-7dc0141dc0a5
{
"count": 1,
"network": [
{
"acltype": "Domain",
"broadcastdomaintype": "Vlan",
"broadcasturi": "vlan://52",
"canusefordeploy": true,
"cidr": "10.0.100.0/24",
"created": "2025-08-05T17:58:26+0000",
"details": {},
"displaynetwork": true,
"displaytext": "Test Shared Network for PR 11242",
"dns1": "10.0.32.1",
"dns2": "8.8.8.8",
"domain": "ROOT",
"domainid": "793fb714-7213-11f0-b207-1e00e0000162",
"domainpath": "/",
"gateway": "10.0.100.1",
"hasannotations": false,
"id": "72ee02a2-1b13-49e5-9986-7dc0141dc0a5",
"ispersistent": false,
"issystem": false,
"name": "pr11242-shared-network",
"netmask": "255.255.255.0",
"networkdomain": "cs1cloud.internal",
"networkofferingavailability": "Optional",
"networkofferingconservemode": true,
"networkofferingdisplaytext": "Offering for Shared Security group enabled networks",
"networkofferingid": "0bc1a291-b495-44a7-8cd8-5a7c01123f91",
"networkofferingname": "DefaultSharedNetworkOfferingWithSGService",
"physicalnetworkid": "866dd47e-a785-478c-bec7-a1666dda7405",
"privatemtu": 1500,
"publicmtu": 1500,
"receivedbytes": 0,
"redundantrouter": false,
"related": "72ee02a2-1b13-49e5-9986-7dc0141dc0a5",
"restartrequired": false,
"sentbytes": 0,
"service": [
{
"capability": [
{
"canchooseservicecapability": false,
"name": "AllowDnsSuffixModification",
"value": "true"
}
],
"name": "Dns",
"provider": [
{
"name": "VirtualRouter"
}
]
},
{
"capability": [],
"name": "SecurityGroup",
"provider": [
{
"name": "SecurityGroupProvider"
}
]
},
{
"capability": [
{
"canchooseservicecapability": false,
"name": "DhcpAccrossMultipleSubnets",
"value": "true"
}
],
"name": "Dhcp",
"provider": [
{
"name": "VirtualRouter"
}
]
},
{
"capability": [],
"name": "UserData",
"provider": [
{
"name": "VirtualRouter"
}
]
}
],
"specifyipranges": true,
"specifyvlan": true,
"state": "Setup",
"strechedl2subnet": false,
"subdomainaccess": true,
"supportsvmautoscaling": false,
"tags": [],
"traffictype": "Guest",
"type": "Shared",
"vlan": "52",
"zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
"zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
}
]
}
IP: 10.0.100.38 on shared network (VLAN 52)
Confirms explicit shared network access still works
Evidence
- No deployment failures - the original bug (deployment failures) is resolved
- Both deployment scenarios work - with and without networkids specification
- User can access both network types - isolated and shared networks appear in user's network list
- Graceful fallback behavior - system selects appropriate network instead of failing
@rosi-shapeblue |
|
[SF] Trillian test result (tid-14033)
|
|
Merging based on approvals and manual test by @rosi-shapeblue |
Description
This PR fixes #11129
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?